package com.system.elasticjob.job;

import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;

//@Component
public class SpringRunnerJob implements SimpleJob {

    @Override
    public void execute(ShardingContext shardingContext) {
        System.out.println(this.getClass() + "：分片总数是: [{" + shardingContext.getShardingTotalCount() + "}]; 当前分片项是: [{" + shardingContext.getShardingItem() + "}]");
        //分片参数，（0=text,1=image,2=video，参数就是text、image...）
        String shardingParameter = shardingContext.getShardingParameter();
        //任务参数
        String jobParameter = shardingContext.getJobParameter();
        System.out.println("current sharding item " + shardingContext.getShardingItem() + ", shardingParameter = " + shardingParameter + ", jobParameter：" + jobParameter);
    }
}
